package spring.boot.admin.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * redis多数据源使用方法示例类，可以随时删除
 */
@RestController
@RequestMapping("/login/redis")
public class RedisController {

    @Autowired
    private StringRedisTemplate oneStringRedisTemplate;

    @Autowired
    private StringRedisTemplate twoStringRedisTemplate;

    @GetMapping("redis")
    public void redis(){
        oneStringRedisTemplate.opsForValue().set("one","one");
        twoStringRedisTemplate.opsForValue().set("two","two");
    }

}
